<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>

  <body>
    <div id="app"></div>
    <script>
    //   let s = new Set([1, 2, 3, 4])
    //   console.log(s)
    //   //   console.log(typeof s);
    //   s.add(5)
    //   console.log(s)
    //   console.log(s.size)
    // let arr = [1,2,2,3,6,7,7]
    // let arr2 = [...new Set(arr)]
    // console.log(arr2);
      let a = [1,2,3];
      let b = [4,3,2];
    
      //3、获取交集
      let result3 = [...new Set(a)].filter((item)=>{
        return new Set(b).has(item)
      })
      console.log(result3);
    </script>
  </body>
</html>
